﻿<phone:PhoneApplicationPage
    x:Class="AirControlATV.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d"
    xmlns:AirControl="clr-namespace:AirControlATV.Controls"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <controls:Pivot Title="MY APPLICATION">
            <!--Pivot item one-->
            <controls:PivotItem Header="Control">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20*"/>
                        <RowDefinition Height="90*"/>
                        <RowDefinition Height="90*"/>
                        <RowDefinition Height="90*"/>
                        <RowDefinition Height="90*"/>
                        <RowDefinition Height="20*"/>
                        <RowDefinition Height="90*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <AirControl:AirControlButton Grid.Column="1" Margin="2" Grid.Row="2" AirControlCommandType="Select" />
                    <AirControl:AirControlButton Grid.Column="1" Margin="2" Grid.Row="1" AirControlCommandType="ArrowUp" />
                    <AirControl:AirControlButton Grid.Column="0" Margin="2" Grid.Row="2" AirControlCommandType="ArrowLeft" />
                    <AirControl:AirControlButton Grid.Column="2" Margin="2" Grid.Row="2" AirControlCommandType="ArrowRight" />
                    <AirControl:AirControlButton Grid.Column="1" Margin="2" Grid.Row="3" AirControlCommandType="ArrowDown" />
                    <AirControl:AirControlButton Grid.Column="0" Margin="2" Grid.Row="4" AirControlCommandType="Menu" />
                    <AirControl:AirControlButton Grid.Column="2" Margin="2" Grid.Row="4" AirControlCommandType="PlayPause" />
                    <AirControl:AirControlButton Grid.Column="0" Margin="2" Grid.Row="6" AirControlCommandType="MyMedia" />
                    <AirControl:AirControlButton Grid.Column="1" Margin="2" Grid.Row="6" AirControlCommandType="Netflix" />
                    <AirControl:AirControlButton Grid.Column="2" Margin="2" Grid.Row="6" AirControlCommandType="YouTube" />
                </Grid>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="Text input">
                <TextBox VerticalAlignment="Top" Margin="10" TextChanged="TextBox_TextChanged" />
            </controls:PivotItem>
            <controls:PivotItem Header="Setup">
                <Grid>
                    <TextBlock HorizontalAlignment="Left" Margin="10,22,0,0" TextWrapping="Wrap" Text="Apple TV IP Address:" VerticalAlignment="Top"/>
                    <TextBox Height="72" Name="AppleTVAddressTextBox" Margin="10,54,0,0" VerticalAlignment="Top" Text="{Binding AppleTVAddress, Source={StaticResource AirControlSettings}, Mode=TwoWay}" Loaded="AppleTVAddressTextBox_Loaded" TextChanged="AppleTVAddressTextBox_TextChanged"/>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>